import Vue from 'vue'
import VueRouter from 'vue-router'
import homePage from "../views/homePage/homePage";
import findPage from "../views/findPage/findPage";
import orderPage from "../views/orderPage/orderPage";
// import user from "../views/user/user";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: homePage
  },
  {
    path: '/find',
    name: '发现',
    component: findPage
  },
  {
    path: '/order',
    name: '订单',
    component: orderPage
  },

  {
    path: '/user',
    name: 'user',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/user/user')
    }
  },
  {
    path: '/sign',
    name: '登录',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../components/login/sign')
    }
  },
  {
    path: '/login',
    name: '注册',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../components/login/login')
    }
  },
  {
    path: '/business',
    name: '商家',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../components/businessInfor')
    }
  },
  {
    path: '/pay',
    name: '确认订单',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../components/payPage')
    }
  },
  {
    path: '/online',
    name: '在线支付',

    component: function () {
      return import(/* webpackChunkName: "about" */ '../components/onlinePay')
    }
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
